﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Td.Additional.ComponentModel
{
    /// <summary>
    /// Integer number range attribute class.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
    public sealed class IntRangeAttribute : Attribute
    {
        #region Properties

        /// <summary>
        /// Gets the min value.
        /// </summary>
        /// <value>The min value.</value>
        public int MinValue { get; private set; }

        /// <summary>
        /// Gets the max value.
        /// </summary>
        /// <value>The max value.</value>
        public int MaxValue { get; private set; }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="IntRangeAttribute"/> class.
        /// </summary>
        /// <param name="minValue">The min value.</param>
        /// <param name="maxValue">The max value.</param>
        public IntRangeAttribute(int minValue, int maxValue)
            : base()
        {
            MinValue = minValue;
            MaxValue = maxValue;
        }

        #endregion
    }
}